**PLOS One: McLaughlin, Mewhirter & Sanders (2021)
**Code by Jack Mewhirter
**Code upated: 02/20/2020
**Contact information: jack.mewhirter@uc.edu



**VARIABLE INCLUSION
//DV: risk_index
//MAIN IV: trust_science_polmotives
//science trust controls: trust_science_betterment trust_science_community
//trust in institutions: govtrust_index trust_media
//trust in communication from institutions: trust_science_politicians trust_science_media
//exposure: infected_personal infected_network
//pandemic impact personal: finances_covid_personal mental_covid_personal
//pandemic impact network: finances_covid_network mental_covid_network 
//scientific knowledge: nsindex 
//indviduals to blame + individual's are responsibile for their own protection: individuals_to_blame + individual_responsibility
//dogmatism: dogmatism_scale
//race, education, age, political affiliation, and trump approval: race college age pol trump
//risk conditions (yes/no): condition_pregnant condition_asthma condition_lung condition_diabetes condition_immune condition_obesity condition_heart condition_organ



**DOWNLOAD NEEDED PACKAGES
//ssc install scheme_tufte   //theme 
//ssc install marhis         //for figure 1
//ssc install outreg2        //for table export


**LOAD DATA & SET SCHEME
clear
set scheme tufte
set more off
use "C:\Users\Mewhirjk\OneDrive - University of Cincinnati\Desktop\Working Projects\pone\data.dta"



**MAIN MODEL: TABLE A2 (PART 1) + FIGURE 1
xtmixed risk_index  c.trust_science_polmotives##c.trust_science_polmotives trust_science_betterment trust_science_community govtrust_index trust_media trust_science_politicians trust_science_media infected_personal infected_network finances_covid_personal mental_covid_personal finances_covid_network mental_covid_network  nsindex individuals_to_blame individual_responsibility dogmatism_scale i.race college age i.pol trump condition_pregnant condition_asthma condition_lung condition_diabetes condition_immune condition_obesity condition_heart condition_organ  || state:
estat ic
outreg2 using main,  replace alpha(0.001, 0.01, 0.05) word onecol dec(3)
marhis trust_science_polmotives, percent
margins, at(trust_science_polmotives=(0 10))  //4.736073 TO 6.15544
margins, at(trust_science_betterment=(0 10))  //5.509224 TO 5.899531



//LINEAR MODEL: TABLE A2 (PART 2 + VIF)
xtmixed risk_index                            trust_science_polmotives trust_science_betterment trust_science_community govtrust_index trust_media trust_science_politicians trust_science_media infected_personal infected_network finances_covid_personal mental_covid_personal finances_covid_network mental_covid_network  nsindex individuals_to_blame  individual_responsibility dogmatism_scale i.race college age i.pol trump condition_pregnant condition_asthma condition_lung condition_diabetes condition_immune condition_obesity condition_heart condition_organ   ||state:
outreg2 using main, word alpha(0.001, 0.01, 0.05) onecol  dec(3)
estat ic
reg risk_index  c.trust_science_polmotives##c.trust_science_polmotives trust_science_betterment trust_science_community govtrust_index trust_media trust_science_politicians trust_science_media infected_personal infected_network finances_covid_personal mental_covid_personal finances_covid_network mental_covid_network  nsindex individuals_to_blame  individual_responsibility dogmatism_scale i.race college age i.pol trump condition_pregnant condition_asthma condition_lung condition_diabetes condition_immune condition_obesity condition_heart condition_organ 
vif
reg risk_index                                trust_science_polmotives trust_science_betterment trust_science_community govtrust_index trust_media trust_science_politicians trust_science_media infected_personal infected_network finances_covid_personal mental_covid_personal finances_covid_network mental_covid_network  nsindex individuals_to_blame  individual_responsibility dogmatism_scale i.race college age i.pol trump condition_pregnant condition_asthma condition_lung condition_diabetes condition_immune condition_obesity condition_heart condition_organ 
vif


//ALT MODEL : Drop ST-Community
xtmixed risk_index  c.trust_science_polmotives##c.trust_science_polmotives trust_science_betterment  govtrust_index trust_media trust_science_politicians trust_science_media infected_personal infected_network finances_covid_personal mental_covid_personal finances_covid_network mental_covid_network  nsindex individuals_to_blame individual_responsibility dogmatism_scale i.race college age i.pol trump condition_pregnant condition_asthma condition_lung condition_diabetes condition_immune condition_obesity condition_heart condition_organ  || state:
outreg2 using main,   alpha(0.001, 0.01, 0.05) word onecol dec(3)




//SUMMARY STATS: TABLE A1
sum risk_index  trust_science_polmotives trust_science_betterment trust_science_community govtrust_index trust_media trust_science_politicians trust_science_media infected_personal infected_network finances_covid_personal mental_covid_personal finances_covid_network mental_covid_network  nsindex individuals_to_blame  individual_responsibility dogmatism_scale college age  trump condition_pregnant condition_asthma condition_lung condition_diabetes condition_immune condition_obesity condition_heart condition_organ
tab pol 
tab race  
tab state 



//STAGGERED REGRESSION: TABLE A3
xtmixed risk_index  c.trust_science_polmotives##c.trust_science_polmotives  if nmissing_ns<6 || state: //IV ONLY
estat ic
outreg2 using alt_models, word dec(2) alpha(0.001, 0.01, 0.05) replace onecol
xtmixed risk_index  c.trust_science_polmotives##c.trust_science_polmotives trust_science_betterment trust_science_community   || state: //IV + science trust controls
estat ic
outreg2 using alt_models, word dec(2) alpha(0.001, 0.01, 0.05) onecol 
xtmixed risk_index  c.trust_science_polmotives##c.trust_science_polmotives govtrust_index trust_media trust_science_politicians trust_science_media   || state: //IV ONLY
estat ic
outreg2 using alt_models, word dec(2) alpha(0.001, 0.01, 0.05) onecol
xtmixed risk_index  c.trust_science_polmotives##c.trust_science_polmotives infected_personal infected_network  || state: //IV + infected
estat ic
outreg2 using alt_models, word dec(2) alpha(0.001, 0.01, 0.05) onecol
xtmixed risk_index  c.trust_science_polmotives##c.trust_science_polmotives finances_covid_personal mental_covid_personal  finances_covid_network mental_covid_network   || state: //IV + covid impact
estat ic
outreg2 using alt_models, word dec(2) alpha(0.001, 0.01, 0.05) onecol
xtmixed risk_index  c.trust_science_polmotives##c.trust_science_polmotives  nsindex  || state: //IV + nsindex
estat ic
outreg2 using alt_models, word dec(2) alpha(0.001, 0.01, 0.05) onecol
xtmixed risk_index  c.trust_science_polmotives##c.trust_science_polmotives  individuals_to_blame individual_responsibility  || state: //IV + individual blame & resposibility 
estat ic
outreg2 using alt_models, word dec(2) alpha(0.001, 0.01, 0.05) onecol
xtmixed risk_index  c.trust_science_polmotives##c.trust_science_polmotives  dogmatism_scale   || state: //IV + dognatisn
estat ic
outreg2 using alt_models, word dec(2) alpha(0.001, 0.01, 0.05) onecol
xtmixed risk_index  c.trust_science_polmotives##c.trust_science_polmotives i. race college age i.pol trump   || state: //IV + demos & politics
estat ic
outreg2 using alt_models, word dec(2) alpha(0.001, 0.01, 0.05) onecol
xtmixed risk_index  c.trust_science_polmotives##c.trust_science_polmotives condition_pregnant condition_asthma condition_lung condition_diabetes condition_immune condition_obesity condition_heart condition_organ   || state: //IV + risk
estat ic
outreg2 using alt_models, word dec(2) alpha(0.001, 0.01, 0.05) onecol




